
from . import models
from utils import ali_sms


def send_sms_code(phone, code):
    uuid, ret = ali_sms.send_sms_verify_code(phone, code)
    print("ali_sms.send_sms_verify_code(phone, code)")
    return uuid, ret


def update_sms_record_status(phone, data):
    record_obj = models.SmsRecord.objects.filter(phone=phone).first()
    if record_obj:
        for k, v in data.items():
            setattr(record_obj, k, v)
        record_obj.save()
    return record_obj

